home *** CD-ROM | disk | FTP | other *** search
/ Trouble & Attitude 4 / Trouble and Attitude - Issue 04.iso / mac / DATA / MOVIES / COMMON.Cxt / 00136_Field_Intro INDEX TEMPLATE.txt < prev    next >
Text File  |  1997-01-14  |  5KB  |  180 lines

  1.  
  2. --
  3. -- INDEX PAGE script
  4. --
  5.  
  6. on stringDigit int
  7.   case int of
  8.     0: return "0"
  9.     1: return "1"
  10.     2: return "2"
  11.     3: return "3"
  12.     4: return "4"
  13.     5: return "5"
  14.     6: return "6"
  15.     7: return "7"
  16.     8: return "8"
  17.     9: return "9"
  18.     otherwise
  19.       return "*"
  20.   end case
  21. end stringDigit
  22.  
  23.  
  24. on enterFrame
  25.   
  26.   global gSoloMode
  27.   global gControlIcon -- channel for control panel icon
  28.   global gControlPanel -- control panel object
  29.   global gFeatureIconFirst, gFeatureIconLast -- range of channels for feature icons
  30.   global gDepartmentIconFirst, gDepartmentIconLast -- range of channels for department icons
  31.   global gLocalSound, gMusicOn, gCaptionOn
  32.   global gCurPath, gNavMode
  33.   global gFeatureMovies, gDepartmentMovies
  34.   
  35.   set gNavMode = "index"
  36.   
  37.   
  38.   cursor -1
  39.   
  40.   -- make sure the control panel is current in every way
  41.   
  42.   if objectP(gControlPanel) then
  43.     tell window "Control Panel"
  44.       setIconStatus "music", gMusicOn
  45.       setIconStatus "caption", gCaptionOn
  46.     end tell
  47.   end if
  48.   
  49.   -- Set up the sprite/channel relationship for this section 
  50.   
  51.   -- Intro Sprites
  52.   set gFeatureIconFirst = 7   -- range of feature icon channels 
  53.   set gFeatureIconLast = 12
  54.   set gDepartmentIconFirst = 14  -- range of dept icon channels
  55.   set gDepartmentIconLast = 20
  56.   set gControlIcon = 22
  57.   
  58.   if voidP("gLocalSound") then
  59.     set gLocalSound = FALSE
  60.   else
  61.     set gLocalSound = FALSE
  62.   end if
  63.   
  64.   puppetsprite gIndexIcon TRUE
  65.   set the member of sprite gControlIcon to member "control-icon"
  66.   set N = 1
  67.   repeat with C = gFeatureIconFirst to gFeatureIconLast
  68.     puppetsprite C TRUE
  69.     set the member of sprite C to member ("feature-" & N & "-icon")
  70.     set N = N + 1
  71.   end repeat
  72.   set N = 1
  73.   repeat with C = gDepartmentIconFirst to gDepartmentIconLast
  74.     puppetsprite C TRUE
  75.     set the member of sprite C to member ("department-" & N & "-icon")
  76.     set N = N + 1
  77.   end repeat
  78.   
  79.   set touched = FALSE
  80.   if rollOver(gControlIcon) then
  81.     set the member of sprite gControlIcon to member "control-icon-hot"
  82.     set the text of member "Message Text" to  "Reveal the control panel"
  83.     set touched = TRUE
  84.   end if
  85.   set N = 1
  86.   repeat with C = gFeatureIconFirst to gFeatureIconLast
  87.     if rollOver(C) then
  88.       set the member of sprite C to member ("feature-" & N & "-icon-hot")
  89.       set the text of member "Message Text" to  "Feature article..."
  90.       set touched = TRUE
  91.     end if
  92.     set N = N + 1
  93.   end repeat
  94.   set N = 1
  95.   repeat with C = gDepartmentIconFirst to gDepartmentIconLast
  96.     if rollOver(C) then
  97.       set the member of sprite C to member ("department-" & N & "-icon-hot")
  98.       set the text of member "Message Text" to  "Department..."
  99.       set touched = TRUE
  100.     end if
  101.     set N = N + 1
  102.   end repeat
  103.   
  104.   if touched = FALSE then
  105.     set the text of member "Message Text" to  "Click on one of the icons..."
  106.   end if
  107.   
  108.   dontPassEvent
  109.   
  110. end enterFrame
  111.  
  112. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  113.  
  114. on exitFrame 
  115.   
  116.   global gMovieName, gMovie, gSoloMode
  117.   global gNextIcon, gPreIcon, gBackIcon, gIndexIcon, gFirstIcon
  118.   global gButton1, gButton2, gButton3
  119.   global gTest
  120.   
  121.   if gSoloMode = FALSE then 
  122.     keepmusic
  123.   end if
  124.   
  125.   set gTest = 1
  126.   go to the frame 
  127.   
  128.   dontPassEvent
  129.   
  130. end exitFrame
  131.  
  132. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
  133.  
  134. on MouseUp
  135.   
  136.   global gMovieName, gMovie, gSoloMode
  137.   global gControlIcon, gDepartmentIconFirst, gFeatureIconFirst
  138.   global gDepartmentIconLast, gFeatureIconLast, gDestination
  139.   
  140.   set destination = "*"
  141.   
  142.   if the ClickOn = gControlIcon then
  143.     openControlPanel
  144.   end if
  145.   
  146.   set N = 1
  147.   repeat with C = gFeatureIconFirst to gFeatureIconLast
  148.     if the clickOn = C then
  149.       set destination = getAt(gFeatureMovies, N)
  150.       set destinationType = "F"
  151.       set loadingFrame =  ( destinationType & stringDigit(N) )
  152.     end if
  153.     set N = N + 1
  154.   end repeat
  155.   
  156.   set N = 1
  157.   repeat with C = gDepartmentIconFirst to gDepartmentIconLast
  158.     if the clickOn = C then
  159.       set destination = getAt(gDepartmentMovies, N)
  160.       set destinationType = "D"
  161.       set loadingFrame =  ( destinationType & stringDigit(N) )
  162.     end if
  163.     set N = N + 1
  164.   end repeat
  165.   
  166.   if destination <> "*" then
  167.     repeat with C = gFeatureIconFirst to gFeatureIconLast
  168.       puppetsprite C FALSE
  169.     end repeat
  170.     repeat with C = gDepartmentIconFirst to gDepartmentIconLast
  171.       puppetsprite C FALSE
  172.     end repeat
  173.     puppetsprite gControlIcon FALSE
  174.     set gDestination = destination
  175.     go to frame loadingFrame
  176.   end if
  177.   
  178. end MouseUp
  179.  
  180.